﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="titles.aspx.vb" Inherits="prueba.WebForm11" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table id="table1" style="width:100%;">
    <tr>
        <td>
            <asp:GridView ID="GridView1" runat="server" DataSourceID="titlesSqlDataSource1" 
                AutoGenerateColumns="False" DataKeyNames="title_id">
                <Columns>
                    <asp:BoundField DataField="title_id" HeaderText="title_id" ReadOnly="True" 
                        SortExpression="title_id" />
                    <asp:BoundField DataField="title" HeaderText="title" SortExpression="title" />
                    <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" />
                    <asp:BoundField DataField="pub_id" HeaderText="pub_id" 
                        SortExpression="pub_id" />
                    <asp:BoundField DataField="price" HeaderText="price" SortExpression="price" />
                    <asp:BoundField DataField="advance" HeaderText="advance" 
                        SortExpression="advance" />
                    <asp:BoundField DataField="royalty" HeaderText="royalty" 
                        SortExpression="royalty" />
                    <asp:BoundField DataField="ytd_sales" HeaderText="ytd_sales" 
                        SortExpression="ytd_sales" />
                    <asp:BoundField DataField="notes" HeaderText="notes" SortExpression="notes" />
                    <asp:BoundField DataField="pubdate" HeaderText="pubdate" 
                        SortExpression="pubdate" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="titlesSqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:pubsConnectionString23 %>" 
                DeleteCommand="DELETE FROM [titles] WHERE [title_id] = @title_id" 
                InsertCommand="INSERT INTO [titles] ([title_id], [title], [type], [pub_id], [price], [advance], [royalty], [ytd_sales], [notes], [pubdate]) VALUES (@title_id, @title, @type, @pub_id, @price, @advance, @royalty, @ytd_sales, @notes, @pubdate)" 
                SelectCommand="SELECT * FROM [titles]" 
                UpdateCommand="UPDATE [titles] SET [title] = @title, [type] = @type, [pub_id] = @pub_id, [price] = @price, [advance] = @advance, [royalty] = @royalty, [ytd_sales] = @ytd_sales, [notes] = @notes, [pubdate] = @pubdate WHERE [title_id] = @title_id">
                <DeleteParameters>
                    <asp:Parameter Name="title_id" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="TxtBox1title_id" Name="title_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox2title" Name="title" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox3type" Name="type" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox4pub_id" Name="pub_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox5price" Name="price" PropertyName="Text" 
                        Type="Decimal" />
                    <asp:ControlParameter ControlID="TxtBox6advance" Name="advance" 
                        PropertyName="Text" Type="Decimal" />
                    <asp:ControlParameter ControlID="TxtBox6royalty" Name="royalty" 
                        PropertyName="Text" Type="Int32" />
                    <asp:ControlParameter ControlID="TxtBox7ytd_sales" Name="ytd_sales" 
                        PropertyName="Text" Type="Int32" />
                    <asp:ControlParameter ControlID="TxtBox8notes" Name="notes" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox9pubdate" Name="pubdate" 
                        PropertyName="Text" Type="DateTime" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="title" Type="String" />
                    <asp:Parameter Name="type" Type="String" />
                    <asp:Parameter Name="pub_id" Type="String" />
                    <asp:Parameter Name="price" Type="Decimal" />
                    <asp:Parameter Name="advance" Type="Decimal" />
                    <asp:Parameter Name="royalty" Type="Int32" />
                    <asp:Parameter Name="ytd_sales" Type="Int32" />
                    <asp:Parameter Name="notes" Type="String" />
                    <asp:Parameter Name="pubdate" Type="DateTime" />
                    <asp:Parameter Name="title_id" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label1" runat="server" Text="title_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox1title_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label2" runat="server" Text="title"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox2title" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label3" runat="server" Text="type"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox3type" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label4" runat="server" Text="pub_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox4pub_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label5" runat="server" Text="price"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox5price" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label6" runat="server" Text="advance"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox6advance" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label7" runat="server" Text="royalty"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox7royalty" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label8" runat="server" Text="ytd_sales"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox8ytd_sales" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label9" runat="server" Text="notes"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox9notes" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label10" runat="server" Text="pubdate"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox10pubdate" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Button ID="Button1" runat="server" Text="Enviar" />
                    <asp:Button ID="Button2" runat="server" Text="BORRAR" style="height: 26px" />
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>
